package com.example.myspringbootpj.controller;

import com.example.myspringbootpj.mapper.WordMapper;
import com.example.myspringbootpj.service.StudyService;
import com.example.myspringbootpj.service.WordService;
import jakarta.servlet.http.HttpSession;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ReviewController {
private final WordMapper wordMapper;

@Autowired
public ReviewController(WordMapper wordMapper) {
    this.wordMapper = wordMapper;
}

//获取学过的单词
    @GetMapping("/getReview")
    public String findReviewStudy(HttpSession session) {

        String userID = (String) session.getAttribute("userID");

        List<String> wordTexts = wordMapper.getReviews(userID);

        return wordTexts.toString();
    }
}
